package eee.xiang.cloud_learning.service.design.responsibility;

/**
 * @Description
 * @Author Eee_xiang
 * @Date 2021/10/28
 **/
public class Client {
    public static void main(String[] args) {
        //创建请求对象
        Request request = new Request();
        request.setData(new Stu("小朋友", 17));
        //创建响应对象
        Reponse reponse = new Reponse();
        //创建一个过滤器链
        FilterChain filterChain = new FilterChain();
        filterChain.addFilter(new StuAgeFilter());
        filterChain.addFilter(new StuNameFilter());
        //执行
        filterChain.doFilter(request, reponse, filterChain);
        reponse.getData().forEach(System.out::println);
    }
}
